////////////////////////////////////////////////////////////////////////////////////////////////////
// color-coded normal direction visualiser
////////////////////////////////////////////////////////////////////////////////////////////////////

#ifdef GL_FRAGMENT_PRECISION_HIGH
	precision highp float;
#else
	precision mediump float;
#endif

const int num_lights = 1;

struct LightModelProducts {
	vec4 sceneColor;	// Ecm + Acm * Acs
};

uniform LightModelProducts lightModelProduct;

varying vec3 n_obj_i;				// surface normal vector in object space
varying vec3 l_obj_i[num_lights];	// light-source vector in object space, one per light
varying vec3 h_obj_i[num_lights];	// half-direction vector in object space, one per light

void main()
{
	vec3 n = n_obj_i * 0.5 + 0.5;

	gl_FragColor = vec4(n, lightModelProduct.sceneColor.w);
}
